package com.uni.crawl.common.util;

import cn.hutool.core.util.RandomUtil;
import com.uni.crawl.common.enums.crawl.CrawlPrefixEnum;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class CodeUtil {

    private static final String BASE = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

    public static String genCode(CrawlPrefixEnum crawlPrefixEnum) {
        String suffix = RandomUtil.randomString(BASE, 6);
        return crawlPrefixEnum + "$" + suffix;
    }

}
